home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-10-06 | 2.0 KB | 79 lines | [TEXT/CWIE] |
- ///--------------------------------------------------------------------------------------
- // SWStats.h
- ///--------------------------------------------------------------------------------------
-
- #ifndef __SWSTATS__
- #define __SWSTATS__
-
- #ifndef __SPRITEWORLD__
- #include <SpriteWorld.h>
- #endif
-
-
- ///--------------------------------------------------------------------------------------
- // Definitions
- ///--------------------------------------------------------------------------------------
-
-
- typedef enum
- {
- kRightJustify = 0,
- kLeftJustify
- } JustifyType;
-
-
- // This structure is used for each stats box to tell the digit-drawing
- // routines where to draw the numbers, and what number to draw.
- typedef struct
- {
- SpriteRec srcSpriteP; // the Sprite
- long theNum; // the current number (up to 10 digits long)
- short numDigits; // how many digits can fit in the box
- JustifyType justification; // right or left justified
- Boolean fillWithZeros; // whether to display as 001 or just 1.
- DrawProcPtr drawProc; // the DrawProc used to draw each digit
- } StatsStruct, *StatsStructPtr;
-
-
- ///--------------------------------------------------------------------------------------
- // Function Prototypes
- ///--------------------------------------------------------------------------------------
-
- SpritePtr CreateStatsSpriteClone(
- SpritePtr masterSpriteP,
- short numDigits,
- JustifyType justification,
- Boolean fillWithZeros);
-
- OSErr SetUpStatsSprite(
- SpritePtr statsSpriteP,
- SpriteLayerPtr dstSpriteLayer,
- DrawProcPtr drawProcP,
- short horizLoc,
- short vertLoc,
- long theNum);
-
- OSErr DrawPictInFrame(
- FramePtr dstFrameP,
- short pictID);
-
- void SetStatsSpriteDrawProc(
- SpritePtr srcSpriteP,
- DrawProcPtr drawProc);
-
- void SetStatsSpriteNumber(
- SpritePtr srcSpriteP,
- long newNumber);
-
- long GetStatsSpriteNumber(SpritePtr srcSpriteP);
-
- SW_FUNC void StatsItemDrawProc(
- FramePtr srcFrameP,
- FramePtr dstFrameP,
- Rect* srcRectP,
- Rect* dstRectP);
-
- short GetNumberLength(long theNum);
-
-
- #endif /* __SWSTATS__ */